package xyz.xtt.exchange.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.extern.slf4j.Slf4j;
import xyz.xtt.common.response.ApiResult;
import xyz.xtt.exchange.response.ArtAmberCardResponse;
import xyz.xtt.exchange.service.ITblArtAmberCardService;

/**
 * @author huqibo
 * @date 2024/11/13
 */
@Schema(name = "下单", description = "下单")
@Slf4j
@RestController
@RequestMapping("/api/exchange")
public class OrderController {
	/**
	 * 下单接口
	 */
//	@Autowired
//	private TblAssetTransactionService tblAssetTransactionService;
	@Autowired
	private ITblArtAmberCardService iTblArtAmberCardService;

//	@Operation(summary = "下单接口")
//	@PostMapping("/order")
//	public ApiResult<OrderResponse> order(@RequestHeader("uid") String uid, @RequestBody @Valid OrderRequest orderRequest) {
//		log.info("/api/exchange/order uid:{} param: {}", uid, JSONUtil.toJsonStr(orderRequest));
//		OrderResponse order = tblAssetTransactionService.order(uid, orderRequest);
//		return ApiResult.ok(order);
//	}

	@Operation(summary = "卡片详情")
	@GetMapping("/card/info")
	public ApiResult<List<ArtAmberCardResponse>> info(@RequestHeader("uid") Long uid, @RequestParam(required = false) Long orderId) {
		log.info("/api/exchange/card/info uid:{},orderId:{}", uid, orderId);
		List<ArtAmberCardResponse> info = iTblArtAmberCardService.queryCards(uid, orderId);
		return ApiResult.ok(info);
	}
}
